package com.hut.oa.model.bean;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * 邮件管理表
 * @author 熊涛
 *
 */
@Entity
@Table(name="email_manage")
public class EmailManage {

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	@Column(name="em_id")
	private Long emId;//邮件管理表id
	
	@Column(name="em_title")
	private String emTitle;//邮件主题
	
	@Column(name="em_content")
	private String emContent;//邮件内容
	
	@Column(name="em_type",nullable=false)	
	private Integer emType=0;//邮件类型
	
	@Column(name="em_status",nullable=false)
	private Long emStatus=0L;//邮件状态
	
	@ManyToOne
	@JsonIgnore
	@JoinColumn(name="em_account_id",nullable=false)
	private User getuser;//接收方id
	
	@Column(name="em_es_id")
	private Long emEsId;//邮件分类(草稿箱)
	
	@Column(name="em_star",nullable=false)
	private Integer emStar=0;//邮件星标
	
	@Column(name="em_is_read",nullable=false)
	private Integer emIsRead=0;//已读
	
	@ManyToOne
	@JsonIgnore
	@JoinColumn(name="em_user_send_id",nullable=false)
	private User senduser;//发送方id
	
	@Column(name="em_time",nullable=false)
	private Date emTime;//发送时间
	
	@Column(name="em_is_delete",nullable=false)
	private Integer emIsDelete=0;//是否放入回收站
		
	
	@Column(name="em_getusername")
	private String emgetusername;//存放多个联系人的名字
	
	@Column(name="em_getuserid")
	private String emgetuserid;//存放多个联系人的id
	
	@Column(name="em_att_id")
	private Long attid=0l;//附件id
	
	public EmailManage() {}

	public Long getEmId() {
		return emId;
	}

	public void setEmId(Long emId) {
		this.emId = emId;
	}

	public String getEmTitle() {
		return emTitle;
	}

	public void setEmTitle(String emTitle) {
		this.emTitle = emTitle;
	}

	public String getEmContent() {
		return emContent;
	}

	public void setEmContent(String emContent) {
		this.emContent = emContent;
	}

	public Integer getEmType() {
		return emType;
	}

	public void setEmType(Integer emType) {
		this.emType = emType;
	}

	public Long getEmStatus() {
		return emStatus;
	}

	public void setEmStatus(Long emStatus) {
		this.emStatus = emStatus;
	}
	
	public Long getEmEsId() {
		return emEsId;
	}

	public void setEmEsId(Long emEsId) {
		this.emEsId = emEsId;
	}

	public Integer getEmStar() {
		return emStar;
	}

	public void setEmStar(Integer emStar) {
		this.emStar = emStar;
	}

	public Integer getEmIsRead() {
		return emIsRead;
	}

	public void setEmIsRead(Integer emIsRead) {
		this.emIsRead = emIsRead;
	}



	public User getGetuser() {
		return getuser;
	}

	public void setGetuser(User getuser) {
		this.getuser = getuser;
	}

	public User getSenduser() {
		return senduser;
	}

	public void setSenduser(User senduser) {
		this.senduser = senduser;
	}

	public Date getEmTime() {
		return emTime;
	}

	public void setEmTime(Date emTime) {
		this.emTime = emTime;
	}

	public Integer getEmIsDelete() {
		return emIsDelete;
	}

	public void setEmIsDelete(Integer emIsDelete) {
		this.emIsDelete = emIsDelete;
	}
	

	public String getEmgetusername() {
		return emgetusername;
	}

	public void setEmgetusername(String emgetusername) {
		this.emgetusername = emgetusername;
	}

	public String getEmgetuserid() {
		return emgetuserid;
	}

	public void setEmgetuserid(String emgetuserid) {
		this.emgetuserid = emgetuserid;
	}

	public Long getAttid() {
		return attid;
	}

	public void setAttid(Long attid) {
		this.attid = attid;
	}

	@Override
	public String toString() {
		return "EmailManage [emId=" + emId + ", emTitle=" + emTitle + ", emContent=" + emContent + ", emType=" + emType
				+ ", emStatus=" + emStatus + ", emEsId=" + emEsId + ", emStar=" + emStar + ", emIsRead=" + emIsRead
				+ ", emTime=" + emTime + ", emIsDelete=" + emIsDelete + "]";
	}

	
	
}
